package com.aliyun.oss.userController;

import com.aliyun.oss.UserService.CategoryService;
import com.aliyun.oss.pojo.Entity.Category;
import com.aliyun.oss.pojo.Vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;

    @GetMapping("/list")
    public ResultVO list(Integer type){
        List<Category> list = categoryService.list(type);
        return ResultVO.success(list);
    }
}
